Collapses node with <span class="argument">id</span>.

<div class="definition">
    collapse(id)
</div>

<div class="arguments">
    <table>
    <tr>
        <td>id</td>
        <td><b>string</b>, id of the sidebar node</td>
    </tr>
    </table>
</div>
Returns <i>undefined</i>.

<h4>Description</h4>

The node must exists in the <a class="method" href="w2sidebar.nodes">.nodes</a> array of the sidebar or its nested nodes. The node is
identified by the <span class="property">.id</span> property. The method will set <span class="property">.expanded</span> property of the
node to false. The method emits <a class="method" href="w2sidebar.onCollapse">.onCollapse</a> event.
<div style="height: 10px"></div>

If you have defined object in the following way:
<textarea class="javascript">
let sidebar = new w2sidebar({
    name : 'sidebar',
    img  : 'icon-page',
    nodes: [
        { id: 'id-1', text: 'Level 1', hidden: true },
        { id: 'id-2', text: 'Level 2', expanded: true, nodes: [
            { id: 'id-2-1', text: 'Level 2.1' },
            { id: 'id-2-2', text: 'Level 2.2' }
        ]},
        { id: 'id-3', text: 'Level 3' }
    ]
});
</textarea>

You can:
<textarea class="javascript">
w2ui.sidebar.collapse('id-2');
</textarea>
